'use strict';

module.exports = app => {
  const mongoose = app.mongoose;
  const Schema = mongoose.Schema;

  const ArticleSchema = new Schema({
    title: { type: String },
    content: { type: String },
    createTime: { type: Date },
    history: { type: Boolean, default: false }, // 往期回顾
    avatar: { type: String },
  });

  return mongoose.model('Article', ArticleSchema);
};
